package com.appspot.finajjarane.framework.models;

import com.appspot.finajjarane.framework.generic.ApplicationConstants;
import com.appspot.finajjarane.framework.generic.Utils;


public class JSONModel {

	// Status set in ApplicationConstantes.java
	protected int status;
	protected String message;
	protected String title;


	public JSONModel(int status, String message, String title){
		this.setStatus(status);
		this.setMessage(message);
		this.setTitle(title);
	}

	public JSONModel(){}


	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public static JSONModel emptyJSONModel(){
		return new JSONModel();
	}

	public static JSONModel exceptionJSONModel(String exceptionMessage){
		String title = Utils.getTranslatedMessage(ApplicationConstants.JSON_EXCEPTION_MESSAGE_GENERAL, null);
		return new JSONModel(ApplicationConstants.JSON_STATUS_EXCEPTION, exceptionMessage, title);
	}

}
